<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="view_param_payable_ledger_report" model="ir.ui.view">
			<field name="name">Payable Ledger Report</field>
			<field name="model">param.payable.ledger.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="AP Ledger Report"> 
					<group>
						<field name="fiscal_year"/>
						<field name="target_move"/>
						<notebook colspan="4">
							<page string="Supplier">
								<group>
									<field name="report_type" attrs="{'invisible': [('report_type','=','payable')]}"/>
									<field name="supplier_search_vals" />
									<field name="filter_selection" />
									<field name="partner_default_from" attrs="{'invisible': [('filter_selection','!=','def')], 'required': [('filter_selection','=','def')]}"
										options='{"quick_create": false}'
										domain="[('supplier','=',True), ('is_company','=',True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}"/>
									<field name="partner_default_to" attrs="{'invisible': [('filter_selection','!=','def')], 'required': [('filter_selection','=','def')]}"
										options='{"quick_create": false}'
										domain="[('supplier','=',True), ('is_company','=',True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}"/>
									<field name="partner_input_from"
										attrs="{'invisible': [('filter_selection','!=','input')], 'required': [('filter_selection','=','input')]}"
										/>
									<field name="partner_input_to"
										attrs="{'invisible': [('filter_selection','!=','input')], 'required': [('filter_selection','=','input')]}"/>
									<field name="partner_ids" domain="[('supplier','=',True), ('is_company','=',True)]"
										attrs="{'invisible': [('filter_selection','!=','selection')], 'required': [('filter_selection','=','selection')]}" nolabel="1" colspan="4">
										<tree>
											<field name="name"/>
											<field name="ref"/>
										</tree>
									</field>
								</group>
							</page>
							<page string="Date">
								<group>
									<field name="date_selection" on_change="onchange_date_selection(date_selection)" />
									<field name="date_from" attrs="{'invisible': [('date_selection','!=','date_sel')], 'required': [('date_selection','=','date_sel')]}"/>
									<field name="date_to" attrs="{'invisible': [('date_selection','!=','date_sel')], 'required': [('date_selection','=','date_sel')]}"/>
									<field name="period_filter_selection" attrs="{'invisible': [('date_selection','!=','period_sel')], 'required': [('date_selection','=','period_sel')]}"/>
									<field name="period_default_from"
										attrs="{'invisible': ['|', ('date_selection','!=','period_sel'), ('period_filter_selection','!=','def')], 'required': [('date_selection','=','period_sel'),('period_filter_selection','=','def')]}"/>
									<field name="period_default_to"
										attrs="{'invisible': ['|', ('date_selection','!=','period_sel'),('period_filter_selection','!=','def')], 'required': [('date_selection','=','period_sel'),('period_filter_selection','=','def')]}"/>
									<field name="period_input_from"
										attrs="{'invisible': ['|', ('date_selection','!=','period_sel'),('period_filter_selection','!=','input')], 'required': [('date_selection','=','period_sel'),('period_filter_selection','=','input')]}"/>
									<field name="period_input_to"
										attrs="{'invisible': ['|',('date_selection','!=','period_sel'),('period_filter_selection','!=','input')], 'required': [('date_selection','=','period_sel'),('period_filter_selection','=','input')]}"/>
								</group>
							</page>
						</notebook>
					</group>

						<footer>
							<!-- label colspan="2" nolabel="1" string=" "/ !-->
							 
							<!-- button name="generate" string="Print" colspan="2" type="object" icon="gtk-ok"/ !-->
							<button name="create_vat" string="Print as PDF" type="object" default_focus="1" class="oe_highlight"/>
	                    	or
	                    	<button name="print_report" string="Print as XLS" type="object" class="oe_highlight" context="{'xls_output':1}"/>
		            		or
		            		<button class="oe_link" special="cancel" string="Cancel" />
						</footer>
					
				</form>
			</field>
		</record>

		<record id="payable_ledger_result_csv_view" model="ir.ui.view">
			<field name="name">Payable Ledger Report</field>
			<field name="model">param.payable.ledger.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Report Options">
					<field name="data" filename="filename"  readonly="1"/>
					<field name="filename" invisible="1"/>
					<group>
						<button class="oe_link" special="cancel" string="Cancel"/>
					</group>
				</form>
			</field>
		</record>

		<record id="action_param_payable_ledger_report" model="ir.actions.act_window">
			<field name="name">Payable Ledger Report</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">param.payable.ledger.report</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_param_payable_ledger_report"/>
			<field name="target">new</field>
			<field name="help">This menu print AP Ledger Report.</field>
		</record>
		
		<menuitem name="Payable Ledger" parent="menu_ap_report"
			action="action_param_payable_ledger_report" id="menu_payable_ledger" sequence="20"/>
	</data>
</openerp>
